Lesson: 11 - Basic variables and operators

Purpose : Students learn the usage of variables as available in Scratch. ( in addition with Motion, Looks, Events).

Materials Required

Scratch 3.0

Prior knowledge

Understanding of Sprites, Backdrops and Costumes. Students should be aware of the ask block in sensing.

Exercises

Exercise:1



  1. Create a Program for doing basic operations(Add, Sub, Multiply, Divide) by getting two values from the user.


Exercise Video



  1. Click here to view a model video for exercise - 1.

Exercise:2



  1. Create a program in which the sprite will ask some questions to the user. Then the sprite stores all the answers by using variables and creates a story with them.

Exercise Video



  1. Click here to view a model video for exercise-2.

Solutions



  • Click here to view the sb3 file to complete exercise 1.
  • Click here to view the sb3 file to complete exercise 2.

  • Teacher's Instruction
    1. Teachers should teach how to create Variables with examples. For now teacher should only create variables for “all sprites” or Global variables. No need to mention this. Sprite variables will be covered in a later lesson.
    2. Teachers should teach how to initialize the value and then change the value of Variables.
    3. Recall the lesson on RAM from last year. Mention that these variables are stored in the RAM. How these are there only as long as the program is running. This is a perfect example of temporary or volatile storage. Note also that the running program itself is also there in the RAM.